package com.wm.command;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassName: Invoker
 * @Description: 命令的调用者
 * @Author: WM
 * @Date: 2023/5/6 9:16
 */
public class Invoker {
    private final Logger logger = LoggerFactory.getLogger(Invoker.class);
    private Command command;

    public Invoker(Command command) {
        this.command = command;
    }

    /**
     * 执行调取到的命令
     *
     * @param commandMessage
     */
    public void action(String commandMessage) {
        logger.info("command sending...");
        command.exe(commandMessage);
    }
}
